#-*- coding:utf-8 -*-
from Tkinter import *
import tkMessageBox

from Tkinter import *
import tkMessageBox

class Application(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()
        self.createWidgets()

    def createWidgets(self):
        self.nameInput = Entry(self)
        self.nameInput.pack()
        lNum =range(10)
        for i in lNum:
            self.alertButton= Button(self, text=i, command=self.hello)
            self.alertButton.pack()



    def hello(self):
        name = self.nameInput.get() or 'world'
        tkMessageBox.showinfo('Message', 'Hello, %s' % name)
    def calculate(self):
        pass


if __name__=="__main__":
    app= Application();
    # app.master.title('Hello Worl')
    # 主消息循环:
    app.mainloop()